<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition template="../templates/commonClient.xhtml">
	<ui:define name="pageTitle">Title</ui:define>
	<ui:define name="pageHeader">Header</ui:define>

	<ui:define name="container">
		<h:form>
		<div class="row section">
		<div class="row ">
				<div class="col-lg-12">
					<h1 class="page-header">
						Voyage Sélectionné <small>de voyage pack</small>
					</h1>
					<ol class="breadcrumb">
						<li><a href="accueil.jsf">Accueil</a></li>
						<li><a href="index.html">Offres de voyages</a></li>
						<li><a href="index.html">#{frontBean.destination}</a></li>
						<li class="active">Récapitulatif de réservation</li>
					</ol>
				</div>

			</div>

			<div class="row">
				<div class="col-lg-9">
					<div class="panel panel-default">
					<c:forEach items="#{frontBean.listVoyageReservation}" var="voyage">
						<div class="panel-heading">Récapitulation de la commande</div>
						<div class="panel-body">
							<div class="form-group">
								<label>Départ</label> 
								<h:inputText class="form-control" disabled="true"  value="#{voyage.depart}"/>
							</div>
							<div class="form-group">
								<label>Destination</label> 
								<h:inputText class="form-control" disabled="true" value="#{voyage.destination}"/>
							</div>
							<div class="form-group">
								<label for="disabledSelect">Date aller</label> 
								<h:inputText class="form-control" type="text" placeholder="Disabled input" disabled="true" value="#{voyage.dateDepart}"/>
							</div>
							<div class="form-group">
								<label for="disabledSelect">Date retour</label> <h:inputText
									class="form-control"  type="text"
									placeholder="Disabled input" disabled="true" value="#{voyage.dateRetour}"/>
							</div>
							<div class="form-group">
								<label>Nombre de Passagers : </label>
								<h:selectOneMenu value="#{frontBean.nbreDePlaceSelected}">
								<c:forEach var="i" begin="1" end="#{frontBean.nbreDePlace}">
									<f:selectItem itemValue="${i}" />
								 </c:forEach>
								 <f:ajax listener="#{frontBean.listener}" render="result" />
								 </h:selectOneMenu> 
							</div>
							<div class="form-group">
								<label>Prix par personne</label> <h:inputText class="form-control"
									disabled="true" value="#{voyage.prix}"/>
							</div>
							<div class="form-group input-group" style="display: none;">
								<span class="input-group-addon"><i class="fa fa-eur">Prix total</i></span> 
								<h:outputText id="result" type="text" class="form-control" value="#{frontBean.montantCommande}"/>
							</div>
							<div class="col-sm-4 col-sm-offset-5">	
							<c:if test="#{frontBean.nbreDePlace > 0}">					
								<h:commandLink class="btn btn-info"  action="#{frontBean.PaimentVoyage()}" value="Confirmation">
									<f:param name="VoyageId" value="#{voyage.idVoyage}" />
								</h:commandLink>
							</c:if>
							</div>
							</div>	
						</c:forEach>
					</div>

				</div>

				<div class="col-lg-3">
					<div class="panel panel-primary">
						<div class="panel-heading"><strong>Rechercher un Voyage</strong></div>
						<div class="panel-body">
						<div class="input-group">
							<div class="form-group input-group">
								<span class="input-group-addon text-center">Destination :</span>
								<h:inputText type="text" class="form-control"
									placeholder="Destination" value="#{frontBean.destination}" />
							</div>
						</div>
						<div class="col-md-6 col-md-offset-3">
							<h:commandButton class="btn btn-success btn-block" value="Rechercher" action="#{frontBean.rechercherVoyages}" />
						</div>
						</div>
					</div>
				</div>
				</div>
			</div>
			<!-- /.container -->
		</h:form>
	
	</ui:define>

</ui:composition>

</html>